<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ page errorPage="/WEB-INF/jsps/error.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<script type="text/javascript" src="ltrim.js"></script>
<script type="text/javascript" src="sort_table.js"></script>

<!-- link calendar files  --> 
	<script language="JavaScript" src="calendar_db.js"></script> 
	<link rel="stylesheet" href="calendar.css"> 

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Terminplaner - Paul Stranz 6ABIFS</title>



</head>
<body>

<h1>Terminplaner</h1>


<script type="text/javascript" >
window.onload = function() {
	SortTable.init();

}

</script>
		<table border="2" class="sortable" >
		  <thead>
		    <tr>
		      <th>ID</th>
		      <th>Thema</th>
		      <th>Terminanfang</th>
		      <th>Terminende</th>
		      <th>Terminart</th>
		      <th>Prioritaet</th>
		      <td class="no_sort">
		        <a href="AddTerminServlet">
		          <img src="images/add.png" title="Termin hinzufuegen" alt="Termin hinzufuegen" style="border: 0;"/>
		        </a>
		      </td>
		    </tr>
		  </thead>
		  <tbody>
		    <c:forEach var="termin" items="${termine}">
		    <tr>  
		      <td><a href="TerminServlet?TerminId=${termin.getId()}">${termin.getId()}</a></td>
		      <td><a href="TerminServlet?TerminId=${termin.getId()}">${termin.thema}</a></td>
		      <td><a href="TerminServlet?TerminId=${termin.getId()}">${termin.getFormattedTerminAnfang()}</a></td>
		      <td><a href="TerminServlet?TerminId=${termin.getId()}">${termin.getFormattedTerminEnde()}</a></td>
		      <td><a href="TerminServlet?TerminId=${termin.getId()}">${termin.getTerminArt().getKey()}</a></td>
		      <td><a href="TerminServlet?TerminId=${termin.getId()}">${termin.getPrioritaet()}</a></td>
		      <td>
		        <a href="EditTerminServlet?TerminId=${termin.getId()}">
		          <img src="images/image_edit.png" title="Termin bearbeiten" alt="Termin bearbeiten" style="border: 0;"/>
		        </a>
		        <a href="DeleteTerminServlet?TerminId=${termin.getId()}">
		          <img src="images/image_delete.png" title="Termin loeschen" alt="Termin loeschen" style="border: 0;"/>
		        </a>
		       </td>
		    </tr>
		    </c:forEach>
		  </tbody>
		</table>
<br />

<form name="calendar"> 
 
	<!-- calendar attaches to existing form element --> 
	<input type="text" name="calendarinput" value=${calendarinput}> 
	<script language="JavaScript"> 
	new tcal ({
		// form name
		'formname': 'calendar',
		// input name
		'controlname': 'calendarinput'
	});
 
	</script> 
	<br />
	<input type="submit" value="Termin suchen"/>
</form> 
<form action="TerminplanerServlet">
	<input type="submit" value="zuruecksetzen"/>
</form>


</body>
</html>